import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { GymReservationVO, GymReservationForm, GymReservationQuery } from '@/api/primary/gymReservation/types';

/**
 * 查询团课预定日期列表
 * @param query
 * @returns {*}
 */

export const listGymReservation = (query ?: GymReservationQuery) : AxiosPromise<GymReservationVO[]> => {
  return request({
    url: '/primary/gymReservation/list',
    method: 'get',
    params: query
  });
};
/**
 * 新增会员预定团课
 * @param query
 * 
 */
export const getyuyue = (data : any) => {
  console.log(data,'aaaaaaaaa')
  return request({
    url: '/primary/gymReservation/appointment',
    method: 'put',
    data: data
  });
};
/**
 * 查询团课预定日期详细
 * @param id
 */
export const getGymReservation = (id : string | number) : AxiosPromise<GymReservationVO> => {
  return request({
    url: '/primary/gymReservation/' + id,
    method: 'get'
  });
};

/**
 * 新增团课预定日期
 * @param data
 */
export const addGymReservation = (data : GymReservationForm) => {
  return request({
    url: '/primary/gymReservation',
    method: 'post',
    data: data
  });
};

/**
 * 修改团课预定日期
 * @param data
 */
export const updateGymReservation = (data : GymReservationForm) => {
  return request({
    url: '/primary/gymReservation',
    method: 'put',
    data: data
  });
};

/**
 * 删除团课预定日期
 * @param id
 */
export const delGymReservation = (id : string | number | Array<string | number>) => {
  return request({
    url: '/primary/gymReservation/' + id,
    method: 'delete'
  });
};
